package com.itlong.cloud.user.app;

import com.itlong.cloud.POJO.DTO.app.AppAuthPersonGetRoomInfoDTO;
import com.itlong.cloud.POJO.DTO.app.AppGetAuthPersonPageDTO;
import com.itlong.cloud.POJO.DTO.app.AppMineAuthPersonExtendDTO;
import com.itlong.cloud.POJO.PO.AppTempSaveMessagePO;
import com.itlong.cloud.POJO.PO.AppUserInfoPO;
import com.itlong.cloud.POJO.VO.app.*;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * <desc>
 *     新版APP的我版块接口暴露
 * </desc>
 * @createDate 2017/9/21
 */
@FeignClient(name = "user-service")
public interface IAppMineServiceClient {

    /**
     * <desc>
     *      注销账号
     * </desc>
     *
     * @param userId
     * @author Jiaqi.X
     * @createDate 2020/06/01
     */
    @RequestMapping(path = "/user/logOff",method = RequestMethod.POST)
    void logOff(@RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *     APP端_我的,退出登录
     * </desc>
     * @param userId
     * @return
     * @createDate 2017/10/10
     * @author cuiduanwu
     */
    @RequestMapping(path = "/user/loginOut",method = RequestMethod.POST)
    boolean logOut(@RequestParam("userId") String userId) throws Exception;


    /**
     * <desc>
     *     APP端_我的,更新头像
     * </desc>
     * @param userId
     * @param imageStr
     * @param imageType
     * @return
     * @createDate 2017/10/10
     * @author cuiduanwu
     */
    @RequestMapping(path = "/user/updatePhoto",method = RequestMethod.POST)
    String updatePhoto(@RequestParam("userId") String userId,@RequestParam("imageStr") String imageStr,@RequestParam("imageType") String imageType) throws  Exception;


    /**
     * <desc>
     *     APP端_我的,更新昵称
     * </desc>
     * @param userId
     * @param nickName
     * @return
     * @createDate 2017/10/10
     * @author cuiduanwu
     */
    @RequestMapping(path = "/user/updateNickName",method = RequestMethod.POST)
    boolean updateNickName(@RequestParam("userId") String userId,@RequestParam("nickName") String nickName);


    /**
     * <desc>
     *     APP端_我的,更新性别
     * </desc>
     * @param userId
     * @param sex
     * @return
     * @createDate 2017/10/10
     * @author cuiduanwu
     */
    @RequestMapping(path = "/user/updateUserSex",method = RequestMethod.POST)
    boolean updateSex(@RequestParam("userId") String userId,@RequestParam("sex") String sex);

    /**
     * <desc>
     *     APP端_我的版块,新增意见反馈
     * </desc>
     * @param userId
     * @param projectId
     * @param feedBackInfo
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/10
     */
    @RequestMapping(path = "/user/feedBack/add",method = RequestMethod.POST)
    boolean addFeedBackInfo(@RequestParam("userId") String userId,@RequestParam("projectId") String projectId,@RequestParam("feedbackInfo") String feedBackInfo,
                            @RequestParam("problemType") String problemType, @RequestParam("appVersion") String appVersion, @RequestParam("androidVersion") String androidVersion,
                            @RequestParam("phoneModel") String phoneModel, @RequestParam("contactInformation") String contactInformation,
                            @RequestParam(value = "imageUrlStr", required = false) String imageUrlStr, @RequestParam(value = "netType",required = false) String netType,
                            @RequestParam(value = "systemName",required = false) String systemName) throws  Exception;

    /**
     * <desc>
     *     APP端_我的,更新密码
     * </desc>
     * @param userId
     * @param oldPswd 加密后的旧密码
     * @param currentPswd 加密后的新密码
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/11
     */
    @RequestMapping(path = "/user/updatePswd",method = RequestMethod.POST)
    boolean updatePswd(@RequestParam("userId") String userId,@RequestParam("oldPswd") String oldPswd,@RequestParam("currentPswd") String currentPswd);


     /**
      * <desc>
      *      获取授权人列表。
      * <desc/>
      *
      * @param  pageDTO 查询请求参数
      * @return 返回授权人列表信息
      * @author shengen.T
      * @createDate 2017/11/10
      */
    @RequestMapping(path = "/user/authPerson/list",method = RequestMethod.POST)
    Page<AppMineGetAuthPersonPageVO> getAuthPersonPage(@RequestBody AppGetAuthPersonPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      获取被授权人的房间列表信息。
     * <desc/>
     *
     * @param  pageDTO
     * @return
     * @author shengen.T
     * @createDate 2018-01-23
     */
    @RequestMapping(path = "/user/authPerson/getRoomInfoList",method = RequestMethod.POST)
    List<AppMineGetAddressInfoVO> getAuthPersonRoomInfo(@RequestBody AppAuthPersonGetRoomInfoDTO pageDTO) throws Exception;


    /**
     * <desc>
     *      添加授权人信息。
     * <desc/>
     *
     * @param  saveDTO 请求参数
     * @return 返回授权人列表信息
     * @author shengen.T
     * @createDate 2017/11/13
     */
    @RequestMapping(path = "/user/authPerson/add",method = RequestMethod.POST)
    Map<String, Object> addAuthPerson(@RequestBody AppMineAuthPersonExtendDTO saveDTO) throws Exception;

     /**
      * <desc>
      *      删除授权人员。
      * <desc/>
      *
      * @param parentUserId 业主用户ID
      * @param authPhoneNo 被授权的手机号
      * @param projectId 项目编号
      * @return 返回影响行数
      * @author shengen.T
      * @createDate 2017/11/15
      */
    @RequestMapping(path = "/user/authPerson/delete",method = RequestMethod.POST)
    boolean deleteAuthPerson(@RequestParam("parentUserId") String parentUserId,@RequestParam("authPhoneNo") String authPhoneNo,@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      获取用户二维码
     * </desc>
     *
     * @param projectId 项目id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/11/15
     */
    @RequestMapping(path = "/user/getUserQrcode",method = RequestMethod.POST)
    AppGetQrcodeVO getUserQrcode(@RequestParam("projectId") String projectId,@RequestParam("userId") String userId,
                                 @RequestParam(value = "roomId",required = false) String roomId) throws ParseException;
    /**
     * <desc>
     *      更新授权人的备注。
     * <desc/>
     *
     * @param authPhoneNo 授权手机号
     * @param projectId 项目编号
     * @param parentUserId 业主ID
     * @param userRemarks 备注
     * @return
     * @author shengen.T
     * @createDate 2017/11/15
     */
    @RequestMapping(path = "/user/authPerson/update",method = RequestMethod.POST)
    Integer updateUserRemarks(@RequestParam("authPhoneNo") String authPhoneNo,
                              @RequestParam("projectId") String projectId,
                              @RequestParam("parentUserId") String parentUserId,
                              @RequestParam("userRemarks") String userRemarks) throws Exception;


    /**
     * <desc>
     *      获取房间的入住人数
     * <desc/>
     *
     * @param  userId 用户ID
     * @param  projectId  项目编号
     * @param  roomId 房间编号
     * @return
     * @author shengen.T
     * @createDate 2018-01-10
     */
    @RequestMapping(path = "/user/authPerson/getUserRoomCount",method = RequestMethod.POST)
    Integer getUserRoomCount(@RequestParam("userId") String userId,
                             @RequestParam("projectId") String projectId,
                             @RequestParam("roomId") String roomId) throws Exception;

    /**
     * <desc>
     *      根据手机号查询用户ID
     * <desc/>
     *
     * @param  phoneNo 授权人手机号
     * @return
     * @author shengen.T
     * @createDate 2018-01-10
     */
    @RequestMapping(path = "/user/authPerson/getUserIdByPhoneNo",method = RequestMethod.POST)
    AppUserInfoPO getUserInfoByPhoneNo(@RequestParam("phoneNo") String phoneNo) throws Exception;

    /**
     * <desc>
     *     跟据项目编号获取最大授权数。
     * <desc/>
     *
     * @param  projectId 项目编号
     * @return
     * @author shengen.T
     * @createDate 2018-01-10
     */
    @RequestMapping(path = "/user/authPerson/getMaxAuthNum",method = RequestMethod.POST)
    Integer getMaxAuthNum(@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      获取房间名称。
     * <desc/>
     *
     * @param roomId 房间编号
     * @param projectId 项目编号
     * @return
     * @author shengen.T
     * @createDate 2017-12-14
     */
    @RequestMapping(path = "/user/authPerson/getRoomName",method = RequestMethod.POST)
    String getRoomName(@RequestParam("projectId") String projectId,
                       @RequestParam("roomId") String roomId) throws Exception;


    /**
     * <desc>
     *      获取用户在该项目该业主下是否授权过房间的数目。
     * <desc/>
     *
     * @param  parentUserId 业主ID
     * @param  userId 用户ID
     * @param  projectId 项目ID
     * @return
     * @author shengen.T
     * @createDate 2017/11/23
     */
    @RequestMapping(path = "/user/authPerson/getUserAuthRelationCount",method = RequestMethod.POST)
    Integer getUserAuthRelationCount(@RequestParam("parentUserId") String parentUserId,
                                     @RequestParam("userId") String userId,
                                     @RequestParam("projectId") String projectId) throws Exception;


    /**
     * <desc>
     *      获取APP用户项目关系表的状态。
     * <desc/>
     *
     * @param  userId
     * @param  projectId
     * @return
     * @author shengen.T
     * @createDate 2018-01-16
     */
    @RequestMapping(path = "/user/authPerson/getAppUserProjectStatus",method = RequestMethod.POST)
    Integer getAppUserProjectStatus(@RequestParam("userId") String userId,@RequestParam("projectId")  String projectId) throws Exception;


    /**
     * <desc>
     *      用户是否是vip
     * <desc/>
     *
     * @param  userId
     * @param  projectId
     * @return
     * @author pengwei
     * @createDate 2020-11-12
     */
    @RequestMapping(path = "/user/authPerson/appUserIsVip",method = RequestMethod.POST)
    boolean appUserIsVip(@RequestParam("userId") String userId,@RequestParam("projectId")  String projectId) throws Exception;

    /**
     * <desc>
     *      获取项目状态。
     * <desc/>
     *
     * @param  projectId 项目编号
     * @return
     * @author Qiang.S
     * @createDate 2019-01-07
     */
    @RequestMapping(path = "/user/authPerson/getProjectStatus",method = RequestMethod.POST)
    String getProjectStatus(@RequestParam("projectId")  String projectId) throws Exception;

    /**
     * <desc>
     *      获取用户在项目中已认证的房屋
     * </desc>
     *
     * @param userId 用户id
     * @param projectId 项目id
     * @return
     * @author shengen.T
     * @createDate 2017/10/27
     */
    @RequestMapping(path = "/user/authPerson/getOwnerRoomIdLists")
    List<String> getOwnerRoomIdLists(@RequestParam("userId")String userId,
                                                        @RequestParam("projectId")String projectId)throws Exception;

    /**
     * <desc>
     *      获取审核通过的房间列表。
     * <desc/>
     *
     * @param  projectId
     * @param  userId
     * @param  pageNum
     * @return
     * @author shengen.T
     * @createDate 2018-03-26
     */
    @RequestMapping(path = "/user/getPassRoomList",method = RequestMethod.POST)
    Page<AppPassRoomListVO> getPassRoomList(@RequestParam("projectId") String projectId, @RequestParam("userId") String userId, @RequestParam("pageNum") String pageNum) throws Exception;

    /**
     * <desc>
     * 保存app端监听linPhone状态的数据
     * <desc/>
     *
     * @param message linPhone状态的数据
     * @return
     * @author Juguang.S
     * @createDate 2018/05/08
     */
    @PostMapping(path = "/saveMessage")
    void saveMessage(@RequestParam("message") String message,@RequestParam("phoneNum") String phoneNum) throws Exception;

    /**
     * <desc>
     *  根据时间或手机号查询linPhone状态的数据
     * <desc/>
     *
     * @param findTime 传入查询时间
     * @param phoneNum 传入查询手机号
     * @return
     * @author Juguang.S
     * @createDate 2018/05/08
     */
    @PostMapping(path = "/findMessageBytime")
    List<AppTempSaveMessagePO> findMessageBytime(@RequestParam("findTime") String findTime,@RequestParam("phoneNum") String phoneNum) throws Exception;

    /**
     * <desc>
     *      获取用户人脸创建信息
     * </desc>
     *
     * @param userId 用户id
     * @param projectId 项目id
     * @return
     * @author Qiang.S
     * @createDate 2018/05/08
     */
    @RequestMapping(path = "/user/authPerson/getCreateBaiduFaceInfo",method = RequestMethod.POST)
    AppUserFaceVO getCreateBaiduFaceInfo(@RequestParam("userId")String userId,
                                         @RequestParam("projectId")String projectId)throws Exception;

    /**
     * <desc>
     *      修改用户手机
     * </desc>
     *
     * @param userId 用户id
     * @param newPhoneNo 新手机号
     * @return
     * @author Qiang.S
     * @createDate 2018/07/03
     */
    @RequestMapping(path = "/user/authPerson/updateUserPhone",method = RequestMethod.POST)
    Integer updateUserPhone(@RequestParam("userId")String userId, @RequestParam("newPhoneNo")String newPhoneNo)throws Exception;

    /**
     * <desc>
     *      因集成灵云快智需要，需将旧数据用户的SIP账号长度改为31位，并创建及绑定灵云快智用户账号，前端移动端无需调此接口
     *      还需将用户信息推送给所有的云对讲设备
     * <desc/>
     *
     * @return
     * @author Juguang.S
     * @createDate 2018-08-24
     */
    @PostMapping(path = "/updateSipAccount")
    void updateSipAccount() throws  Exception;

    /**
     * <desc>
     *      推送开启云对讲服务的项目设备重启指令
     * <desc/>
     *
     * @return
     * @author Juguang.S
     * @createDate 2019-01-03
     */
    @PostMapping(path = "/pushCommand")
    void pushCommand() throws Exception;

    /**
     * <desc>
     *      因集成灵云快智测试需要，根据userId释放灵云快智账号，前端移动端无需调此接口
     * <desc/>
     *
     * @return
     * @author Juguang.S
     * @createDate 2018-09-11
     */
    @PostMapping(path = "/dropSipAccount")
    void dropSipAccount() throws Exception;

    /**
     * <desc>
     *      补救批量给旧数据绑定灵云快智账号时遗漏账号的操作
     * <desc/>
     *
     * @param  phoneNum 手机号 如有值则创建此手机号的灵云快智账号，如无值则处理所有遗漏创建灵云快智的情况
     * @return
     * @author Juguang.S
     * @createDate 2018-10-15
     */
    @PostMapping(path = "/remedySipAccount")
    void remedySipAccount(@RequestParam("phoneNum") String phoneNum) throws Exception;

    /**
     * <desc>
     *      由账单id查询项目微信公众号appId
     * <desc/>
     *
     * @return 项目微信公众号appId
     * @author wangzhi
     * @createDate 2019/10/23
     */
    @PostMapping(path = "/getAppIdByBillId")
    Map<String, Object> getAppIdByBillId(@RequestParam("billId") String billId) throws Exception;

    /**
     * <desc>
     *      sdk删除用户信息
     * <desc/>
     *
     * @param userId 用户id
     * @return
     * @author Qiang.S
     * @createDate 2020/07/02
     */
    @PostMapping(path = "/logOffUserForSDK")
    void logOffUserForSDK(@RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      物业注销该项目下的人脸信息
     * <desc/>
     *
     * @param userId 用户id
     * @param projectId 项目id
     * @return
     * @author Juguang.S
     * @createDate 2021/04/20
     */
    @PostMapping(path = "/logOffUserForProperty")
    void logOffUserForProperty(@RequestParam("userId") String userId,@RequestParam("projectId") String projectId) throws Exception;


    /**
     * <desc>
     *      获取历史反馈列表
     * </desc>
     *
     * @param userId 用户id列表
     * @param projectId 项目id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/11/12
     */
    @RequestMapping(value = "/app/mine/getFeedbackList", method = RequestMethod.POST)
    List<AppFeedbackInfoVO> getFeedbackList(@RequestParam("userId") String userId,
                                            @RequestParam(value = "projectId",required = false) String projectId,
                                            @RequestParam(value = "page", required = false) String page) throws Exception;


    /**
     * <desc>
     *      获取用户反馈详细信息
     * </desc>
     *
     * @param feedbackId 反馈信息id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/11/12
     */
    @RequestMapping(value = "/app/mine/getFeedbackDetail", method = RequestMethod.POST)
    AppFeedbackInfoVO getFeedbackDetail(@RequestParam("feedbackId") String feedbackId) throws Exception;



    /**
     * <desc>
     *      京东非标-注销用户
     * </desc>
     *
     * @param userId 用户id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/12/17
     */
    @PostMapping("/logOffUserForJdSdk")
    void logOffUserForJdSdk(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception;
}
